<template>
  <div class="snackbar" :class="{ 'show': show, 'correct': type === 'success', 'incorrect': type === 'error' }">
    <div class="snackbar-content">
      <span class="result-icon">{{ type === 'success' ? '✓' : '✗' }}</span>
      {{ message }}
    </div>
  </div>
</template>

<script setup lang="ts">
interface Props {
  show: boolean;
  type: 'success' | 'error';
  message: string;
}

defineProps<Props>();
</script>

<style scoped>
.snackbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 1000;
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
  
  &.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  
  &.correct {
    background: linear-gradient(135deg, #4caf50, #45a049);
    border-left: 4px solid #2e7d32;
  }
  
  &.incorrect {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border-left: 4px solid #c62828;
  }
  
  .snackbar-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    
    .result-icon {
      font-size: 1.2rem;
      font-weight: bold;
    }
  }
}
</style>